﻿@using System.Web.Optimization
@model ManageContentViewModel

@{
    ViewBag.Title = "Manage Content";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@Scripts.Render(Url.Content("~/Scripts/tinymce/tinymce.min.js"))

<script type="text/javascript">
	$(document).ready(function() {
		tinymce.init({
			selector: "textarea",
			theme: "modern",
			width: 700,
			height: 300,
			plugins: [
				 "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
				 "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
				 "save table contextmenu directionality template paste textcolor"
			],
			toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l      ink image | print preview media fullpage | forecolor backcolor"
		});
	});
</script>

<h2>Manage Content</h2>

@using (Html.BeginForm("UpdateContent", "Admin", FormMethod.Post)) {
	@Html.HiddenFor(x => x.Content.Id)
	<label>Content Place Type: </label>@Html.DropDownListFor(x => x.Content.ContentPlace.KeyName, Model.Places)<br/>
	<label>Content Place Name: </label>@Html.TextBoxFor(x => x.Content.ContentPlace.Name)<br/>
	for (var i = 0; i < Model.Content.ContentLocalizations.Count; i++) {
		@Html.HiddenFor(x => x.Content.ContentLocalizations[i].CultureName)
		<h4>@Model.Content.ContentLocalizations[i].CultureName</h4>
		<table class="content-table">
			<tr>
				<td>Title: </td>
				<td class="content_meta">@Html.TextBoxFor(x => x.Content.ContentLocalizations[i].Title)</td>
			</tr>
			<tr>
				<td>Description: </td>
				<td class="content_meta">@Html.TextBoxFor(x => x.Content.ContentLocalizations[i].Description)</td>
			</tr>
			<tr>
				<td>Meta Description: </td>
				<td class="content_meta">@Html.TextBoxFor(x => x.Content.ContentLocalizations[i].MetaDescription)</td>
			</tr>
			<tr>
				<td>Meta Keywords: </td>
				<td class="content_meta">@Html.TextBoxFor(x => x.Content.ContentLocalizations[i].MetaKeywords)</td>
			</tr>
			<tr>
				<td>Body: </td>
				<td>@Html.TextAreaFor(x => x.Content.ContentLocalizations[i].Body)</td>
			</tr>
		</table>
	}
	<br/><br/>
	<input type="submit" value="Save"/>
}